home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / appsrcs.zip / APPMORE.ZIP / APPABOUT.C next >
C/C++ Source or Header  |  1993-04-08  |  2KB  |  56 lines

  1. #define STRICT
  2. #include <windows.h>
  3. #include <windowsx.h>
  4. #include <shellapi.h>
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include "appmore.h"
  8.  
  9. /*************************************************************************/
  10. /*  FUNCTION: DlgAboutProc()                         */
  11. /*                                     */
  12. /*  WindowProc for the AboutBox                         */
  13. /*************************************************************************/
  14. BOOL WINAPI AboutDlgProc(HWND hDlgAbout, UINT message, WPARAM wParam, LPARAM lParam)
  15.     {
  16.     HDC hDC, hDCMem;
  17.     PAINTSTRUCT ps;
  18.     RECT rc;
  19.     BITMAP bm;
  20.  
  21.     switch(message)
  22.     {
  23.     case WM_INITDIALOG:
  24.         return TRUE;
  25.  
  26.     case WM_PAINT:
  27.         hDC = BeginPaint(hDlgAbout, &ps);
  28.         rc = ps.rcPaint;
  29.         // make aboutbox LTGRAY
  30.         FillRect(hDC, (LPRECT) &rc, GetStockBrush(LTGRAY_BRUSH));
  31.  
  32.         // draw two Bitmaps in the AboutBox
  33.         hDCMem = CreateCompatibleDC(hDC);
  34.         GetObject(hAppLogo, sizeof(BITMAP), (LPSTR) &bm);
  35.         SelectBitmap(hDCMem, hAppLogo);
  36.         BitBlt(hDC, ps.rcPaint.left+3*(cxChar/2), ps.rcPaint.top+cyChar, bm.bmWidth, bm.bmHeight, hDCMem, 0, 0, SRCCOPY);
  37.         GetObject(hNNever, sizeof(BITMAP), (LPSTR) &bm);
  38.         SelectBitmap(hDCMem, hNNever);
  39.         BitBlt(hDC, ps.rcPaint.left+3*(cxChar/2), ps.rcPaint.top+cyChar*5, bm.bmWidth, bm.bmHeight, hDCMem, 0, 0, SRCCOPY);
  40.         DeleteDC(hDCMem);
  41.  
  42.         EndPaint(hDlgAbout, &ps);
  43.         return 0;
  44.  
  45.     case WM_COMMAND:
  46.         switch(wParam)
  47.         {
  48.         case IDOK:
  49.             EndDialog(hDlgAbout, 0);
  50.             return TRUE;
  51.         }
  52.         break;
  53.     }
  54.     return FALSE;
  55.     } /* end DlgAboutProc */
  56.